import fetch from 'common/src/utils/fetch'; 
/**
 * 加分管理列表
 * @param {*} data
 */
export function getBonusScoreList (data) {
    return fetch({
        url: '/api/scoremanagementservice/awardedMarksController/queryAwardedMarksList',
        method: 'POST',
        data
    });
}

/**
 * 加分管理添加成绩获取学生信息
 * @param {*} data
 */
export function getStudentInfo (data) {
    return fetch({
        url: '/api/scoremanagementservice/awardedMarksController/queryAwardedMarksCourseList',
        method: 'POST',
        data
    });
}

/**
 * 加分管理添加成绩获取学生信息
 * @param {*} data
 */
export function saveAwardedMarksScore (data) {
    return fetch({
        url: '/api/scoremanagementservice/awardedMarksController/saveAwardedMarksScore',
        method: 'POST',
        data
    });
}

/**
 * 加分成绩导出
 * @param {} data 导出需要参数，页面筛选面板所有参数及学号筛选值及选定行数
 */
export function exportAwardedMarksList(params, ids) {
    let url = '/api/scoremanagementservice/awardedMarksController/exportAwardedMarksList';
    let string = '';
    for (var key in params) {
        if (params[key] === '') {
            continue;
        }
        string += `${key}=${params[key]}&`;
    }
    let restApi = `${url}?${string.substring(0, string.length - 1)}`;
    return fetch({
        url: restApi,
        method: 'post',
        headers: { 'Content-Type': 'text/plain;charset=UTF-8' },
        responseType: 'blob',
        data: ids
    });
}


export function enterVerification(calendarId){
    return fetch({
        url:`/api/scoremanagementservice/awardedMarksController/enterVerification?calendarId=${calendarId}`,
        method:'get'
    })

}
/**
 * 删除
 * @param {*} data 
 */
export function deleteBackScore(data){
    return fetch({
        url:`/api/scoremanagementservice/awardedMarksController/batchDelAwardedMarks`,
        method:'post',
        data
    })

}